/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hypeerweb;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author hogue
 */
public class Connections implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 933070188281096498L;
	ArrayList<Node> neighbors;
	ArrayList<Node> surrogateNeighbors;
	Node fold;
	
	public Connections(ArrayList<Node> neighbors, ArrayList<Node> surrogateNeighbors, Node fold) {
		this.neighbors = neighbors;
		this.surrogateNeighbors = surrogateNeighbors;
		this.fold = fold;
	}
	
	public ArrayList<Node> getNeighbors() {
		return neighbors;
	}
	
	public ArrayList<Node> getSurrogateNeighbors() {
		return surrogateNeighbors;
	}
	
	public Node getFold() {
		return fold;
	}
	
	@Override
	public String toString() {
		StringBuilder result = new StringBuilder();
		
		result.append("neighbors = ");
		
		for (Node neighbor : neighbors)
		{
			result.append(neighbor.getWebIdValue());
			
//			if (neighbor != neighbors.get(neighbors.size() - 1))
//				result.append(", ");
		}
		
		result.append("; surrogateNeighbors = ");
		
		for (Node neighbor : surrogateNeighbors)
		{
			result.append(neighbor.getWebIdValue());
			
//			if (neighbor != surrogateNeighbors.get(surrogateNeighbors.size() - 1))
//				result.append(", ");
		}
		
		result.append("; fold = ");
		result.append(fold.getWebIdValue());
		
		return result.toString();
	}
}
